package com.sugon.cloudaliconfigclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * nacos作为配置中心 控制器
 *
 * RefreshScope 为 spring cloud 原生注解，用于实现配置自动更新
 *
 * @author JH
 * @version 1.0
 * @since 2023/2/20 16:16
 */
//@RefreshScope 动态刷新
@RefreshScope
@RestController
public class ConfigClientController {

    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/config/info")
    public String getConfigInfo() {
        return configInfo;
    }

}
